import service from "../utils/request";

// 一个请求分装成一个函数

// 请求新用户注册01
export function getNew_login(payload = {}) {
    return service.post('/user/register', payload)
}

// 请求用户登录接口02
export function getUser_login(payload = {}) {
    return service.post('/user/login', payload)
}

// 请求首页轮播图03
export function getBanner(payload = {}) {
    return service.get('/index/banner', { params: payload })
}

// 请求首页导航04
export function getNav(payload = {}) {
    return service.get('/index/nav')
}

// 请求首页推荐列表05
export function getGoodList(payload = {}) {
    return service.get('/index/goodlist',{ params: payload })
}

// 请求一级分类接口06
export function get_list(payload = {}) {
    return service.get('/category/list', { params: payload })
}

// 请求二级三级分类接口07
export function get_subcate(payload = {}) {
    return service.get('/category/subcate', { params: payload })
}

// 请求分类搜索接口08
export function getList(payload = {}) {
    return service.get('/good/list', { params: payload })
}

// 热门搜索10
export function getHot_search(payload = {}) {
    return service.get('/good/hotsearch')
}
// 商品详情11
export function getGood_info(payload = {}) {
    return service.get('/good/goodinfo',{ params: payload })
}

// 收藏列表12
export function getGood_favlist(payload = {}) {
    return service.get('/good/favlist',{ params: payload })
}

// 商品收藏13
export function getGood_fav(payload = {}) {
    return service.post('/good/fav',payload)
}

// 取消商品收藏14
export function getGood_unfav(payload = {}) {
    return service.post('/good/unfav',payload)
}

// 购物车列表15
export function getcar_list(payload = {}) {
    return service.get('/shopcart/list',{ params: payload })
}

// 购物车数量+1 17
export function getcar_add(payload = {}) {
    return service.post('/shopcart/add',payload)
}



